//--------------------------------------------------------------------------------
// This file is a portion of the D2D1Renderer.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Mirco Timmermann
//
//--------------------------------------------------------------------------------
#pragma once

#ifndef _POINT_H
#define _POINT_H


class Point2f {

public:
	float x;
	float y;

	Point2f();
	Point2f(float x, float y);
	Point2f(const Point2f &v);
	~Point2f(void);

	//Point  operator *  (const Mat2x2 &mat) const;
	Point2f  operator *  (const Point2f &v) const;
	Point2f  operator /  (const Point2f &v) const;
	Point2f  operator +  (const Point2f &v) const;
	Point2f  operator -  (const Point2f &v) const;
	Point2f  operator *  (float f) const;
	Point2f  operator /  (float f) const;
	Point2f  operator +  (float f) const;
	Point2f  operator -  (float f) const;
	Point2f  operator -  (void) const;
	//void  operator *= (const Mat2x2 &mat);
	void  operator *= (const Point2f &v);
	void  operator /= (const Point2f &v);
	void  operator += (const Point2f &v);
	void  operator -= (const Point2f &v);
	void  operator *= (float f);
	void  operator /= (float f);

	// Per-component comparison:
	bool  operator >  (const Point2f &v) const;
	bool  operator >= (const Point2f &v) const;
	bool  operator <  (const Point2f &v) const;
	bool  operator <= (const Point2f &v) const;
	bool  operator == (const Point2f &v) const;
	bool  operator != (const Point2f &v) const;

	// Type casting
	operator float*();
	operator const float*() const;

	// Swizzles
	Point2f xx() const;
	Point2f xy() const;
	Point2f yx() const;
	Point2f yy() const;

	static Point2f Zero(void);
	static Point2f X(void);
	static Point2f Y(void);

};

#endif

//void normalize(Point point) { //TODO:

//}

